/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Busca.java
 *
 * Created on 16/11/2011, 21:34:01
 */
package gerenciadorescola.view;

import gerenciadorescola.model.pattern.facade.Fachada;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author Pedro Freitas
 */
public class Busca extends javax.swing.JFrame {

    /** Creates new form Busca */
    public Busca() {
        initComponents();
        try {
            Image icon = Toolkit.getDefaultToolkit().getImage("src/gerenciadorescola/imagens/uff.png");
            setIconImage(icon);
        } catch (Exception e) {
            e.getStackTrace();
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        codTLabel = new javax.swing.JLabel();
        codTText = new javax.swing.JTextField();
        nomeTLabel = new javax.swing.JLabel();
        serieLabel = new javax.swing.JLabel();
        respNomeTLabel = new javax.swing.JLabel();
        respSerieLabel = new javax.swing.JLabel();
        respTurnoLabel = new javax.swing.JLabel();
        turnoLabel = new javax.swing.JLabel();
        linguaTLabel = new javax.swing.JLabel();
        respLinguaTLabel = new javax.swing.JLabel();
        buscarTButton = new javax.swing.JButton();
        voltarTButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        codALabel = new javax.swing.JLabel();
        codAText = new javax.swing.JTextField();
        nomeALabel = new javax.swing.JLabel();
        matriculaLabel = new javax.swing.JLabel();
        idadeALabel = new javax.swing.JLabel();
        cpfALabel = new javax.swing.JLabel();
        sexoALabel = new javax.swing.JLabel();
        telALabel = new javax.swing.JLabel();
        endALabel = new javax.swing.JLabel();
        nometurmaLabel = new javax.swing.JLabel();
        linguaALabel = new javax.swing.JLabel();
        respNomeALabel = new javax.swing.JLabel();
        respMatriculaLabel = new javax.swing.JLabel();
        respIdadeALabel = new javax.swing.JLabel();
        respCpfALabel = new javax.swing.JLabel();
        respSexoALabel = new javax.swing.JLabel();
        respTelALabel = new javax.swing.JLabel();
        respEndALabel = new javax.swing.JLabel();
        respNomeTurmaLabel = new javax.swing.JLabel();
        respLinguaALabel = new javax.swing.JLabel();
        buscarAButton = new javax.swing.JButton();
        voltarAButton = new javax.swing.JButton();
        codTurmaALabel = new javax.swing.JLabel();
        codTurmaAText = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        codPLabel = new javax.swing.JLabel();
        codPText = new javax.swing.JTextField();
        nomePLabel = new javax.swing.JLabel();
        idadePLabel = new javax.swing.JLabel();
        cpfPLabel = new javax.swing.JLabel();
        sexoPLabel = new javax.swing.JLabel();
        telPLabel = new javax.swing.JLabel();
        endPLabel = new javax.swing.JLabel();
        salarioLabel = new javax.swing.JLabel();
        espcialLabel = new javax.swing.JLabel();
        respNomePLabel = new javax.swing.JLabel();
        respIdadePLabel = new javax.swing.JLabel();
        respCpfPLabel = new javax.swing.JLabel();
        respSexoPLabel = new javax.swing.JLabel();
        respTelPLabel = new javax.swing.JLabel();
        respEndPLabel = new javax.swing.JLabel();
        respSalarioLabel = new javax.swing.JLabel();
        respDisciplinalLabel = new javax.swing.JLabel();
        buscarPButton = new javax.swing.JButton();
        voltarPButton = new javax.swing.JButton();
        codTurmaPLabel = new javax.swing.JLabel();
        codTurmaPText = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Busca - Escola TPA");

        codTLabel.setText("Código :");

        nomeTLabel.setText("Nome :");

        serieLabel.setText("Série :");

        respNomeTLabel.setText("*************************");

        respSerieLabel.setText("*****");

        respTurnoLabel.setText("***********");

        turnoLabel.setText("Turno :");

        linguaTLabel.setText("Língua Estrangeira :");

        respLinguaTLabel.setText("******************");

        buscarTButton.setText("Buscar");
        buscarTButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscarTButtonActionPerformed(evt);
            }
        });

        voltarTButton.setText("Voltar");
        voltarTButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voltarTButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(codTLabel)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(codTText, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(nomeTLabel)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(respNomeTLabel)))
                            .addContainerGap(176, Short.MAX_VALUE))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(serieLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(respSerieLabel)
                            .addGap(90, 90, 90)
                            .addComponent(turnoLabel)
                            .addGap(18, 18, 18)
                            .addComponent(respTurnoLabel)
                            .addGap(118, 118, 118))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(linguaTLabel)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(respLinguaTLabel)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(buscarTButton)
                        .addGap(18, 18, 18)
                        .addComponent(voltarTButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(47, 47, 47))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(codTLabel)
                    .addComponent(codTText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(39, 39, 39)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomeTLabel)
                    .addComponent(respNomeTLabel))
                .addGap(34, 34, 34)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(serieLabel)
                    .addComponent(respSerieLabel)
                    .addComponent(turnoLabel)
                    .addComponent(respTurnoLabel))
                .addGap(29, 29, 29)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(linguaTLabel)
                    .addComponent(respLinguaTLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 178, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(voltarTButton)
                    .addComponent(buscarTButton))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Turma", jPanel1);

        codALabel.setText("Código :");

        nomeALabel.setText("Nome :");

        matriculaLabel.setText("Matrícula :");

        idadeALabel.setText("Idade :");

        cpfALabel.setText("CPF :");

        sexoALabel.setText("Sexo :");

        telALabel.setText("Telefone :");

        endALabel.setText("Endereço :");

        nometurmaLabel.setText("Turma :");

        linguaALabel.setText("Lingua Estrangeira :");

        respNomeALabel.setText("***********************************************");

        respMatriculaLabel.setText("*********************");

        respIdadeALabel.setText("******");

        respCpfALabel.setText("***********************");

        respSexoALabel.setText("******");

        respTelALabel.setText("*****************");

        respEndALabel.setText("********************************************");

        respNomeTurmaLabel.setText("***********************");

        respLinguaALabel.setText("*****************");

        buscarAButton.setText("Buscar");
        buscarAButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscarAButtonActionPerformed(evt);
            }
        });

        voltarAButton.setText("Voltar");
        voltarAButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voltarAButtonActionPerformed(evt);
            }
        });

        codTurmaALabel.setText("Turma :");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(nomeALabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(respNomeALabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(matriculaLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respMatriculaLabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(sexoALabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respSexoALabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(telALabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respTelALabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(endALabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respEndALabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(nometurmaLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respNomeTurmaLabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(linguaALabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respLinguaALabel))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                                .addComponent(idadeALabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(respIdadeALabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(cpfALabel))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                                .addComponent(codALabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(codAText, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(respCpfALabel)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(codTurmaALabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(codTurmaAText, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(buscarAButton)
                        .addGap(18, 18, 18)
                        .addComponent(voltarAButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(44, 44, 44))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(codALabel)
                    .addComponent(codAText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(codTurmaALabel)
                    .addComponent(codTurmaAText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomeALabel)
                    .addComponent(respNomeALabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(matriculaLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(respMatriculaLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(idadeALabel)
                    .addComponent(cpfALabel)
                    .addComponent(respIdadeALabel)
                    .addComponent(respCpfALabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sexoALabel)
                    .addComponent(respSexoALabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(telALabel)
                    .addComponent(respTelALabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(endALabel)
                    .addComponent(respEndALabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nometurmaLabel)
                    .addComponent(respNomeTurmaLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(linguaALabel)
                    .addComponent(respLinguaALabel))
                .addGap(31, 31, 31)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buscarAButton)
                    .addComponent(voltarAButton))
                .addGap(42, 42, 42))
        );

        jTabbedPane1.addTab("Aluno", jPanel2);

        codPLabel.setText("Código :");

        nomePLabel.setText("Nome :");

        idadePLabel.setText("Idade :");

        cpfPLabel.setText("CPF :");

        sexoPLabel.setText("Sexo :");

        telPLabel.setText("Telefone :");

        endPLabel.setText("Endereço :");

        salarioLabel.setText("Salário :");

        espcialLabel.setText("Disciplina :");

        respNomePLabel.setText("**********************************************");

        respIdadePLabel.setText("******");

        respCpfPLabel.setText("********************");

        respSexoPLabel.setText("******");

        respTelPLabel.setText("******************");

        respEndPLabel.setText("*******************************************");

        respSalarioLabel.setText("************");

        respDisciplinalLabel.setText("********************");

        buscarPButton.setText("Buscar");
        buscarPButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscarPButtonActionPerformed(evt);
            }
        });

        voltarPButton.setText("Voltar");
        voltarPButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voltarPButtonActionPerformed(evt);
            }
        });

        codTurmaPLabel.setText("Turma :");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(codPLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(codPText, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(codTurmaPLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(codTurmaPText, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(sexoPLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respSexoPLabel))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(telPLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respTelPLabel))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(endPLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respEndPLabel))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(salarioLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respSalarioLabel))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(espcialLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(respDisciplinalLabel))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(nomePLabel)
                            .addComponent(idadePLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(respIdadePLabel)
                                .addGap(70, 70, 70)
                                .addComponent(cpfPLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(respCpfPLabel))
                            .addComponent(respNomePLabel))))
                .addContainerGap(38, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(212, Short.MAX_VALUE)
                .addComponent(buscarPButton)
                .addGap(18, 18, 18)
                .addComponent(voltarPButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(codPLabel)
                    .addComponent(codPText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(codTurmaPLabel)
                    .addComponent(codTurmaPText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomePLabel)
                    .addComponent(respNomePLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(idadePLabel)
                    .addComponent(cpfPLabel)
                    .addComponent(respIdadePLabel)
                    .addComponent(respCpfPLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sexoPLabel)
                    .addComponent(respSexoPLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(telPLabel)
                    .addComponent(respTelPLabel))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(endPLabel)
                    .addComponent(respEndPLabel))
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(salarioLabel)
                            .addComponent(respSalarioLabel))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(espcialLabel)
                            .addComponent(respDisciplinalLabel)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 147, Short.MAX_VALUE)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(buscarPButton)
                            .addComponent(voltarPButton))
                        .addContainerGap())))
        );

        jTabbedPane1.addTab("Professor", jPanel3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 385, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 429, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void voltarTButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voltarTButtonActionPerformed
        this.dispose();
    }//GEN-LAST:event_voltarTButtonActionPerformed

    private void voltarAButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voltarAButtonActionPerformed
        this.dispose();
    }//GEN-LAST:event_voltarAButtonActionPerformed

    private void buscarTButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buscarTButtonActionPerformed
        Map<String, String> entrada = new HashMap();
        Map<String, String> saida = new HashMap();

        entrada.put("codigo", codTText.getText());
        try {
            saida = Fachada.ComandoBuscaTurma(entrada);
            if (!(saida.containsKey("msg"))) {
                respNomeTLabel.setText(saida.get("nome"));
                respSerieLabel.setText(saida.get("serie"));
                respTurnoLabel.setText(saida.get("turno"));
                respLinguaTLabel.setText(saida.get("lingua"));
            } else {
                JOptionPane.showMessageDialog(rootPane, saida.get("msg"));
            }
        } catch (Exception ex) {
            Logger.getLogger(Busca.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_buscarTButtonActionPerformed

    private void voltarPButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voltarPButtonActionPerformed
        this.dispose();
    }//GEN-LAST:event_voltarPButtonActionPerformed

    private void buscarAButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buscarAButtonActionPerformed
        Map<String, String> entrada = new HashMap();
        Map<String, String> saida = new HashMap();

        entrada.put("codigo", codAText.getText());
        entrada.put("codTurma", codTurmaAText.getText());

        try {
            saida = Fachada.ComandoBuscaAluno(entrada);
            if (!(saida.containsKey("msg"))) {
                respNomeALabel.setText(saida.get("nome"));
                respMatriculaLabel.setText(saida.get("matricula"));
                respIdadeALabel.setText(saida.get("idade"));
                respCpfALabel.setText(saida.get("cpf"));
                respSexoALabel.setText(saida.get("sexo"));
                respTelALabel.setText(saida.get("tel"));
                respEndALabel.setText(saida.get("end"));
//                respNomeTurmaLabel.setText("");
                respLinguaALabel.setText("lingua");
            } else {
                JOptionPane.showMessageDialog(rootPane, saida.get("msg"));
            }
        } catch (Exception ex) {
            Logger.getLogger(Busca.class.getName()).log(Level.SEVERE, null, ex);
        }



    }//GEN-LAST:event_buscarAButtonActionPerformed

    private void buscarPButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buscarPButtonActionPerformed
        Map<String, String> entrada = new HashMap();
        Map<String, String> saida = new HashMap();

        entrada.put("codigo", codAText.getText());
        entrada.put("codTurma", codTurmaAText.getText());

        try {
            saida = Fachada.ComandoBuscaProfessor(entrada);
            if (!(saida.containsKey("msg"))) {
                respNomePLabel.setText(saida.get("nome"));
                respIdadePLabel.setText(saida.get("idade"));
                respCpfPLabel.setText(saida.get("cpf"));
                respSexoPLabel.setText(saida.get("sexo"));
                respTelPLabel.setText(saida.get("tel"));
                respEndPLabel.setText(saida.get("end"));
                respSalarioLabel.setText(saida.get("salario"));
                respDisciplinalLabel.setText(saida.get("disciplina"));
            } else {
                JOptionPane.showMessageDialog(rootPane, saida.get("msg"));
            }
        } catch (Exception ex) {
            Logger.getLogger(Busca.class.getName()).log(Level.SEVERE, null, ex);
        }



    }//GEN-LAST:event_buscarPButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Busca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Busca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Busca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Busca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Busca().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buscarAButton;
    private javax.swing.JButton buscarPButton;
    private javax.swing.JButton buscarTButton;
    private javax.swing.JLabel codALabel;
    private javax.swing.JTextField codAText;
    private javax.swing.JLabel codPLabel;
    private javax.swing.JTextField codPText;
    private javax.swing.JLabel codTLabel;
    private javax.swing.JTextField codTText;
    private javax.swing.JLabel codTurmaALabel;
    private javax.swing.JTextField codTurmaAText;
    private javax.swing.JLabel codTurmaPLabel;
    private javax.swing.JTextField codTurmaPText;
    private javax.swing.JLabel cpfALabel;
    private javax.swing.JLabel cpfPLabel;
    private javax.swing.JLabel endALabel;
    private javax.swing.JLabel endPLabel;
    private javax.swing.JLabel espcialLabel;
    private javax.swing.JLabel idadeALabel;
    private javax.swing.JLabel idadePLabel;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel linguaALabel;
    private javax.swing.JLabel linguaTLabel;
    private javax.swing.JLabel matriculaLabel;
    private javax.swing.JLabel nomeALabel;
    private javax.swing.JLabel nomePLabel;
    private javax.swing.JLabel nomeTLabel;
    private javax.swing.JLabel nometurmaLabel;
    private javax.swing.JLabel respCpfALabel;
    private javax.swing.JLabel respCpfPLabel;
    private javax.swing.JLabel respDisciplinalLabel;
    private javax.swing.JLabel respEndALabel;
    private javax.swing.JLabel respEndPLabel;
    private javax.swing.JLabel respIdadeALabel;
    private javax.swing.JLabel respIdadePLabel;
    private javax.swing.JLabel respLinguaALabel;
    private javax.swing.JLabel respLinguaTLabel;
    private javax.swing.JLabel respMatriculaLabel;
    private javax.swing.JLabel respNomeALabel;
    private javax.swing.JLabel respNomePLabel;
    private javax.swing.JLabel respNomeTLabel;
    private javax.swing.JLabel respNomeTurmaLabel;
    private javax.swing.JLabel respSalarioLabel;
    private javax.swing.JLabel respSerieLabel;
    private javax.swing.JLabel respSexoALabel;
    private javax.swing.JLabel respSexoPLabel;
    private javax.swing.JLabel respTelALabel;
    private javax.swing.JLabel respTelPLabel;
    private javax.swing.JLabel respTurnoLabel;
    private javax.swing.JLabel salarioLabel;
    private javax.swing.JLabel serieLabel;
    private javax.swing.JLabel sexoALabel;
    private javax.swing.JLabel sexoPLabel;
    private javax.swing.JLabel telALabel;
    private javax.swing.JLabel telPLabel;
    private javax.swing.JLabel turnoLabel;
    private javax.swing.JButton voltarAButton;
    private javax.swing.JButton voltarPButton;
    private javax.swing.JButton voltarTButton;
    // End of variables declaration//GEN-END:variables
}
